home *** CD-ROM | disk | FTP | other *** search
- NTP for NOS
-
- This is a port of Dennis Ferguson's xntp to run under Phil Karn's NOS
- for the PC. Thanks and kudos to both of them for writing software
- amenable to such a graft.
-
- Things that I have or have not done:
-
- The changes to NOS for NTP to run are relatively minor. The changes
- to the xntp source are much more significant, though I have tried to
- leave xntp alone as much as possible to simplify the incorporation of
- any future updates to xntp. ntp_unixclock.c has been replaced by
- ntp_pcclock.c. ntp_io.c, ntp_timer.c and ntp_config.c have been
- almost entirely rewritten, and most of the functions that were in
- xntp's utility library have instead been dropped into ntp_util.c. The
- other source files have been changed to use different include files
- and to schedule timers differently.
-
- The code to handle authentication, monitoring, and NTP mode 7 packets
- has not been included. All references to these parts of xntp have
- been #ifdef'd out, and the source files specific to these functions
- have been omitted from the NTP under NOS distribution. I have no
- reason to believe that they would be difficult to port, but I
- haven't felt the need for them yet and ntp is large enough as is.
-
- The code to handle and reply to NTP mode 6 packets *is* included. It
- has been conditionalized so that it could be excluded if desired
- (though not tested this way). Mode 6 packets are the only way to see
- what ntp is doing under NOS. I have not included any mechanism for
- examining what ntp is doing from NOS' command line. (Except for
- turning on debugging printfs.) I run ntpq on a Unix box and probe the
- PC over the network.
-
- This version of xntp does not read its own configuration file.
- Instead, each ntp command line typed to NOS is parsed by xntp's
- configuration-file-reading code. I did it this way because I needed
- NTP to run under a port of NOS that cannot do disk accesses (don't
- ask). For the same reason, this version of xntp does not write a
- drift file.
-
- What is included in this tar file:
-
- diff.ntp: context diffs to the 910614 distribution of NOS.
- ntp*.[ch]: The modified xntp source files that are needed.
-
- To compile NTP into NOS, you'll have to edit config.h by hand to
- #define NTP.
-
- To run NTP:
-
- First find some peers. You're on your own for this. The file
- louie.udel.edu:pub/ntp/clock.txt lists some primary servers. You
- should probably try to find peers other than the primary servers to
- avoid thousands of PCs blasting away at the primary servers.
-
- To start NTP, put something like the following in autoexec.net:
- ntp peer somehost
- ntp peer someotherhost
- ntp precision -20
- If you don't have an AT or better, your precision value will be much
- worse (I don't know how well NTP will work with such low-precision
- time stamps):
- ntp precision -4
- If you do have an AT or better, make sure that NOS knows this by
- giving it the "isat on" command.
-
- Nosxntp should be run at least for overnight to let it figure out what the
- drift value is for your particular PC. Typing "ntp drift" to NOS will
- print out the drift value. When it has more-or-less stopped changing,
- you can put the command to set the drift value into autoexec.net:
- ntp drift -0.158 (for example)
-
- Nosxntp initializes its idea of the time from DOS. DOS' time must be
- within a thousand seconds of the actual time, otherwise nosxntp will
- think that things are too far gone and give up. Nosxntp will take at
- least a half hour or so to approach the correct time *if* you have
- initialized the drift (it will get to within a hundred milliseconds or
- so fairly quickly). Otherwise, be prepared to wait a day or so.
-
- Nosxntp running on a genuine AT (ie 8MHz '286) sitting idle in a
- corner keeps time to within a couple milliseconds of a peer sitting on
- the same ethernet. The accuracy goes down as the amount of activity
- on the PC increases. This is because NTP depends on symmetric delays
- to and from the peer. Since NOS is not preemptive, if other processes
- are running then NTP packets may wait on the Hopper for an
- unpredictable time, making the outbound and inbound delays different.
-
- Please report any bugs to me. Note that this code is (at best) a beta
- release. (Not xntp or NOS, but my port of the first to the second. I
- have not yet found any bugs in the parts of xntp that I haven't
- touched.)
-
- Andrew Heybey
- ath@ptt.lcs.mit.edu
-